
<script type="text/javascript"> 
      $(document).ready(function(){
      	$("ul.tabs").tabs("div.panes > div");
	    });
</script>

<script language="javascript">
var xmlHttp

function showKab(str)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="<?php echo site_url().'account/ajax_showKab'?>";
	
	url=url+"/"+str;
	//url=url+"&sid="+Math.random();
	

	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged()
{
if (xmlHttp.readyState==4)
{
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
//alert(document.getElementById("txtHint").innerHTML);
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
</script> 
<script type="text/javascript">
		$(document).ready(function() {
			$("#form_pass").validate({
			
				rules: {
						old_pass: 
						{
							required: true
						},		
					    new_pass: 
						{
							required: true,
							minlength: 5
						},		
					    new_pass_conf:
						{
							required: true,
							equalTo: "#new_pass"
						}
				},
			errorClass: "val",
      	messages: 
				{ 
					old_pass: {
						required: 'Password lama harus diisi'
					},
					new_pass: {
						required : 'Password harus di isi',
						minlength: 'Password minimal 5 karakter'
					},
					new_pass_conf: {
						required: 'Ulangi Password harus di isi',
						equalTo : 'Password tidak sama'
					}
				},
         
         success: function(label) {
            label.text('OK!').addClass('val');
         }
			});
		});
	</script>
<style>
.val{
margin:0px 0px 0px 150px;
color:#000000;
}
.error{
color:#000000;
}

a.link_white{
color:#ccc;
}
a.link_white:hover{
color:#000000;
}

</style>
<div class="left_konten">
	<div class="breadcumbs"><?php echo $cumb;?></div>
	<div class="detail_product">
		<div class="order_content">                   
			<h2>Your Account Details</h2>

			<div id="demo" class="demolayout">
				<ul class="tabs">
					<li><a class="current" href="#">Account</a></li>
					<li><a class="" href="#">Change Password</a></li>
					<li><a class="" href="#">Order History</a></li>
					<li><a class="" href="#">Wishlist</a></li>
				</ul>

				<!-- panes (content untuk masing-masing tab) -->
				<div class="panes">
					<div style="display: block;">
						<form action="" method="post" onsubmit="return check();">
						<div class="form_row">
						<label class="contact"><strong>Name:</strong></label>
						<?php echo form_error('nama', '<div class="error">', '</div>'); ?>
						<input type="text" class="contact_input" name="nama" value="<?php echo $acc->nama; ?>">
						</div> 

						<div class="form_row">
						<label class="contact"><strong>Sex:</strong></label>
						<?php echo form_error('jenkel', '<div class="error">', '</div>'); ?>
						<?php echo jenkelDropdown($acc->jenkel);?>
						</div> 

						<div class="form_row">
						<label class="contact"><strong>Email:</strong></label>
						<?php echo form_error('email', '<div class="error">', '</div>'); ?>
						<input type="text" class="contact_input" name="email" value="<?php echo $acc->email; ?>">
						</div>

						<div class="form_row">
						<label class="contact"><strong>Phone:</strong></label>
						<?php echo form_error('telp', '<div class="error">', '</div>'); ?>
						<input type="text" class="contact_input" name="telp" value="<?php echo $acc->telp; ?>">
						</div>

						<div class="form_row">
						<label class="contact"><strong>Mobile Phone/HP:</strong></label>
						<?php echo form_error('hp', '<div class="error">', '</div>'); ?>
						<input type="text" class="contact_input" name="hp" value="<?php echo $acc->hp; ?>">
						</div>

						<div class="form_row">
						<label class="contact"><strong>Address:</strong></label>
						<?php echo form_error('alamat', '<div class="error">', '</div>'); ?>
						<input type="text" class="contact_input" name="alamat" value="<?php echo $acc->alamat; ?>">
						</div> 

						<div class="form_row">
						<label class="contact"><strong>Province:</strong></label>
						<?php echo form_error('prov_id', '<div class="error">', '</div>'); ?>
						<?php echo provDropdown($acc->mem_prov_id)?>
						</div> 

						<div  class="form_row">
						<label class="contact"><strong>Kabupaten:</strong></label>
						<?php echo form_error('kab_id', '<div class="error">', '</div>'); ?>
						<div id="txtHint">
						<?php echo kabDropdown($acc->mem_prov_id,$acc->mem_kab_id)?>
						</div>
						</div> 

						<div class="form_row">
						<label class="contact"><strong>City:</strong></label>
						<?php echo form_error('kota', '<div class="error">', '</div>'); ?>
						<input type="text" class="contact_input" name="kota" value="<?php echo $acc->kota; ?>">
						</div> 

						<div class="form_row">
						<label class="contact"><strong>Post Code:</strong></label>
						<?php echo form_error('kodepos', '<div class="error">', '</div>'); ?>
						<input type="text" class="contact_input" name="kodepos" value="<?php echo $acc->kodepos; ?>">
						</div> 
						<table width="100%" border="0" cellspacing="0" cellpadding="0" class="">
						<tbody>
						<tr>
						<td width="50%">&nbsp;</td>
						<td> <input type="submit" class="" value="simpan" /></td>
						</tr>
						</tbody>
						</table>
						</form>     
					</div>

					<div style="display: none;">
		
						<form id="form_pass" action="<?php echo site_url()?>account/edit_pass" method="post" onsubmit="return check();">
						<div class="form_row">
						<label class="contact"><strong>Old Password:</strong></label>
						<?php echo form_error('old_pass', '<div class="error">', '</div>'); ?>
						<input type="password" class="contact_input" id="old_pass" name="old_pass" value="<?php echo set_value('old_pass'); ?>">
						</div> 

						<div class="form_row">
						<label class="contact"><strong>New Password:</strong></label>
						<?php echo form_error('new_pass', '<div class="error">', '</div>'); ?>
						<input type="password" class="contact_input" id="new_pass" name="new_pass" value="<?php echo set_value('new_pass'); ?>">
						</div> 

						<div class="form_row">
						<label class="contact"><strong>Retype New Password:</strong></label>
						<?php echo form_error('new_pass_conf', '<div class="error">', '</div>'); ?>
						<input type="password" class="contact_input" id="new_pass_conf" name="new_pass_conf" value="<?php echo set_value('new_pass_conf'); ?>">
						</div>
						
						<table width="100%" border="0" cellspacing="0" cellpadding="0" class="shoppingTable">
						<tbody>
						<tr>
						<td width="50%">&nbsp;</td>
						<td> <input type="submit" class="" value="Submit" /></td>
						</tr>
						</tbody>
						</table>
						</form>
					</div>

					<div style="display: none;">
					
						
							<table width="1" border="0" cellpadding="0">
						  <thead>
							<th>Order Date</th>
							<th>Invoice</th>
							<th>Status</th>
							<th>Total</th>  
							<th>Detail</th>  
					
							</thead>
							<tr>
							<?php foreach($res as $row):;?>
							<tr>
							<td class="isi_tab"><?php echo formatDate($row['order_date'],'short1'); ?></td>
							<td class="isi_tab"><?php echo $row['order_code'];?></td>
							<td class="isi_tab"><?php echo $row['order_status'];?></td></td>
							<td class="isi_tab_numb"><?php echo formatHarga($row['total'], 'lengkap');?></td>
							<td class="isi_tab"><a class="link_white" href="#order<?php echo $row['order_id'];?>" rel="facebox">Detail</a></td>
							</tr>
							<?php endforeach; ?>   
							</tr>              
							</table>
						
					</div>
					<div style="display: none;">
					
						
							<table width="1" border="0" cellpadding="0">
						  <thead>
							<th>No</th>
							<th>Product Name</th>
							<th>Product Brand</th>
							<th>Date</th>

							</thead>
							<?php 
							$i = 1;
							foreach($wish as $row_wish):;?>
							<tr>
							<td class="isi_tab_numb"><?php echo $i;?></td>
							<td class="isi_tab"><?php echo $row_wish['nama_produk']; ?></td>
							<td class="isi_tab"><?php echo $row_wish['nama_brand']; ?></td>
							<td class="isi_tab"><?php echo formatDate($row_wish['date_added'],'short'); ?></td>
							</tr>    
							<?php 
							$i++;
							endforeach;?>
							</table>
						
					</div>
				</div>
				<?php echo getOrderAccount($mem_id);?>

				<div class="clear"></div>
			</div>
		</div>
	</div>
</div>


